# -*- coding: utf-8 -*-

import pandas as pd
import numpy as np
import matplotlib.pyplot as pyplot
import seaborn as sns

from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split

data = pd.read_csv('../diabetes.csv')

## 各个数据的相关性不高，并且基本全部是 int64 和 float64 ， 直接对 x_tain 数据的标准化 , y 因为是 0，1 不做
X_train = data.drop("Outcome",axis=1)
y_train = data["Outcome"]

ss_X = StandardScaler()
X_train_trans = ss_X.fit_transform(X_train)

# 拆分 20% 数据作为测试集
X_train_part, X_test, y_train_part, y_test = train_test_split(X_train_trans, y_train, train_size = 0.8,random_state = 0)

## turn back to DataFrame
X_train_part = pd.DataFrame(data=X_train_part, columns=X_train.columns)
X_test_part = pd.DataFrame(data=X_test, columns=X_train.columns)

print(X_train_part.describe())
print(X_test_part.describe())
